home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NOVA - For the NeXT Workstation
/
NOVA - For the NeXT Workstation.iso
/
Newsletters
/
GEnieUnixNews
/
unxnl-02.92
< prev
next >
Wrap
Text File
|
1992-12-27
|
24KB
|
470 lines
_ _ _ _ _ _
// // //| // // \// N E W S
//_// // |// // /\\ Vol 3, Issue 2 - February 1992
R o u n d T a b l e (tm)
Items of interest to participants of the GEnie Unix RoundTable
The RoundTable SysOps are:
Andy Finkenstadt....ANDY Rick Mobley.........LRARK
Gary Smith..........GARS Brian Riley.........DELPHI
All Unix SysOps.....UNIXSYSOPS$
We strongly encourage you to contact any or all of us if you have -ANY-
comments or suggestions. This is -YOUR- RoundTable. We are here to make
your participation as pleasant and beneficial as possible.
ED: editor notes - added support
--
We are gratified by your response to the new platform specific support
areas for Sun, NeXT, Coherent and Sequent. Needless to say, the enthusiastic
response will only encourage us to continue to strive to provide a fuller
range of resources for all aspects of the operating environments included
under the Unix umbrella.
As library manager for the Unix RoundTable, I am especially pleased with
the increased involvement by several users in building it. Many have taken
the time to share files and I hope their efforts are as appreciated by others
as they are by me. I'm hesitant to single out any one individual or group of
individuals; but I really can't let this opportunity pass to publicly thank
A.ROSENBALM, E.TREMBLAY2, E.UYEDA for really pumping up the libraries with
goodies for NeXT. They have set quite a standard for other platform users to
try to emulate. Nice piece of work!
Add Mike Nolan who has imported the LINUX, Gnu Unix clone for 386's with
all the support files, Irwin Shapiro who is still in the process of uploading
DJGPP, the gcc/g++ frontend for 386, and Keith Smith who posted the current
release of CRISP.
One final note regarding the libraries. At the suggestion of Eric Tremblay
a new library, Library 28 THE GALLERY, has been added so that participants of
the GEnie Unix RoundTable can post their .TIFF or .GIF images of themselves,
thus drawing our community of users even closer together. This library is
for mug shots only. All other graphics files will continue to go into Library
18. Get out those scanners and let's see what you look like!
Upload Contest Winners for Feburary (ANDY)
-----------------------------------
The Unix RoundTable is proud to announce the winners of the
January 1992 Upload Contest. We have many good participants, but
three persons stood out ahead of the rest:
Uploader Total Bytes Uploaded Total number of files
------------ -------------------- ---------------------
E.TREMBLAY2 1653504 27
K.SMITH52 1604352 6
I.SHAPIRO3 1021952 3
As winners of the January 1992 Upload Contest, Eric Tremblay will
be awarded two free days in the Unix RoundTable, and Keith Smith
and Irwin Shapiro will be awarded one day each. Congratulations
to the three of you, and to all the persons who have benefited by
the excellent files uploaded.
Keith uploaded the excellent CRISP editor which works a lot like
the BRIEF programmer's editor. Irwin uploaded the MS-DOS 80386
extender and gcc compiler files, and Eric has uploaded quite a
number of NeXT workstation related files. Great work!
-Andy Finkenstadt
Unix RT Sysop
Lead Sysop Notes (ANDY)
----------------
Greetings! It's now the beginning of February as I write this
note to you. I'd like to thank you for helping make the Unix
RoundTable one of the best places to come for information about
the operating system of the future, here today.
There have been several changes over the last couple of months:
5 new bulletin board categories for the Sun workstation, the NeXT
workstation, the Coherent Unix-like operating system, the Sequent
multi-processor computers, and a brand-new category for
discussing topics which impact on societal and social issues.
(For example, Dick Flanagan started an amusing topic on humorous
commands you can issue.)
Shortly after this writing the entire Unix Library Listings will
be available in one file. They are sorted by name and encompass
files numbered 1 through 2754. The files to look for are
UNIXLIBS.TXT and UNIXLIBS.ZIP. Another copy as UNIXLIBS.Z will
be available soon, as well.
Until next time,
-Andy
System Handy Hint: Do a shutdown!
-----------------
'SCO Magazine, The Journal for builders and Buyers of SCO Open Systems' from
CMP Publications, Inc., 600 Community Drive, Manhasset, NY 11030 made the
following observation in the November 1991 issue, pp.16 in their Pointers:
Reboot at least once a month or even once a week if your Unix box is really
critical to your business. The system is forced to run fsk() on the file-
systems, which cleans up any corrupted files and takes a general inventory
of everything on the disk.
They further point out autobooting or remote booting won't get the job done.
Using cron or similar autoboots causes only a cursory scan of root, thus all
but negating the purpose of the exercise.
WHO short bios
---
This issue we get a closer look at a couple of our new on-line support gurus.
These are the individuals who have graciously volunteered to man the special
platform specific areas.
Frank Cupo, NeXT support
As you know my name is Frank Cupo and I am a 22yr old Service Manager for
Essex Computers in Newark, NJ. I have been interested in computers since I
was thirteen and got my first TI computer.
Since then I've owned and trashed computers from Atari, Commodore, Apple,
and Compaq. Up untill April '91 my main focus was with the Macs and Intel
based products. Since Essex became NeXT authorized in April I have become a
dedicated NeXT support person there. I have just begun to dabble in Unix
itself, most of my time has been spent learning Objective-C. One of my other
NeXT related projects is the initiation of The NeXT Jersey Users Group,
NeXT-JUG. Some of my hobbies include Scuba Diving, Motorcycles, and racing
R.C. cars.
Mike Perry, Sequent support
I've been in Data Processing since 1978. Started out on a Honeywell Level
62 writing in Cobol and RPG II. Went on to work on DG Nova systems using
Cobol then back to Honeywell DPS6 writing Cobol.
Now I work for Sequent Computer Systems as a Regional Technical Support
Specialist. My responsibilities include: Benchmarking, Database Special-
ization (Ingres/Informix), and Unix knowledge.
I'm based in Tampa but report to the Central (Chicago) Region of the
company.
I have a BSCS from Tampa College (Summa) and will be starting on my MS in
the summer. I also have a current ICCP certification as a Certified
Programmer in Commercial and Scientific languages.
I also monitor the Sequent section of the BBS on the Unix roundtable.
FAST and NASTY, DOWN and DIRTY: quick fix scripts that do something
--------------------------------
Subject: Dirtiest little sh test for program existence...
I just discovered this litte nice (:) method which kind of tests the
existence of an executable within $PATH. It goes like this:
#!/bin/sh
prog=$1
if [ ! -z "$prog" ]; then
case "`(. $prog 2>&1)`" in
*"not found"*) echo $prog not found ;;
*) echo $prog found ;;
esac
fi
So what do you people think? Are there shell implementations that will
puke on this one?
--Harald E
From: Harald.Eikrem@delab.sintef.no
Newsgroups: comp.unix.shell
TUTORIALS:
=========
m4(1) - a macro pre-processor Andrew Finkenstadt (ANDY)
-----------------------------
What is m4?
m4 is a filter that reads some files (or the standard input) and
outputs to the standard output the results of the filtering. It
differs from most other filters in that it has some intelligence
built-in that allows it to serve as a very smart 'sed' stream
editor with simple textual substitutions (like replacing all
occurences of the word 'A' with a lower case 'a') or as complex
as making entire subroutines from simple one-line statements.
For example, the Ratfor (rational fortran) pre-compiler uses m4
to take ratfor source code and output "real" fortran code for
feeding into a real fortran compiler.
Other filters that are part of the standard Unix operating system
allow one to sort files, translate between character sets, reject
common words, and so on. Filters are usually used as part of a
pipeline to build complex functions from smaller parts. For
example, one common backup script uses the file find and cpio
programs and the sort and compress filters to build a very
compact backup archive which can be placed onto tape media with
minimal difficulty.
Do not confuse m4 with M-5, the computer-run-amok in Star Trek.
Even though it may seem as though your computer isn't your friend
anymore while you are learning m4, persevere and your rewards
will be great indeed.
In this first article of a series on the topic of using m4 we
explore some of the command line options given to m4 and some
simple textual substitution macros.
Many times I have wished for the ability to use the capabilities
of the C language pre-processor in other areas - especially in
Structured Query Language (SQL) database work. Implementing the
database construct of a domain is relatively easy - but
coordinating the types and sizes of variables in different
database scripts is a pain, and information is lost by using the
base type.
An example follows:
Let's say we want to implement the standard Rolodex card on a
computer using a relational database which lets us speak to it in
SQL instead of the compiled language 'C'. We might build one
table to hold each set of rolodex cards. In the real world we
attempt to put as much information on one card as possible -
including multiple addresses and phone numbers. Like this:
create table my_rolodex (
card_number number(5),
company_name char(50),
related_company char(50),
contact_name char(50),
other_name char(50),
address1 char(50),
citystate1 char(30),
zip1 number(5),
address2 char(50),
citystate2 char(30),
zip2 number(5),
home_phone number(10),
biz_phone number(10),
fax_phone number(10)
);
You may notice that we have allocated space for each field, and
that it just so happens that the amount of space allocated for a
person's name is the same as for a company. Great! At least we
are consistent.
Now you finish your beautiful rolodex application and your most
trusted colleague comes to you and says there are some problems.
First he needs just a couple more characters for the company
name. Secondly he points out that many companies have extensions
on their phone numbers. And finally your beloved friend tells
you that you forgot all about the zip+4 9-digit encoding used by
the post office and canadian zip codes which have letters in
them. Yikes! At least he didn't tell you that your shoes were
ties wrong.
As you begin to look at the rolodex table you see that you could
just use vi and replace all occurences of char(50) with char(60)
for the company names, number(5) with char(9) for the zip codes,
and number(10) with number(15) for the phone numbers - surely no
company has more than 5 digits in an extension.
Unfortunately this will also change fields that you would rather
not touch: the name columns and the card number field. So we
quickly figure out a different method to maintain substitutions
like this.
m4 to the rescue.
=================
Instead of coding the finaly storage types directly in the SQL
language for each column, we resort to using an artificial term
whereever we have something which might change in the future. For
example, our new rolodex table might look like this:
create table my_rolodex (
card_number domain_cardnumber,
company_name domain_company,
related_company domain_company,
contact_name domain_name,
other_name domain_name,
address1 domain_address,
citystate1 domain_city,
zip1 domain_zip,
address2 domain_address,
citystate2 domain_city,
zip2 domain_zip,
home_phone domain_phone,
biz_phone domain_phone,
fax_phone domain_phone
);
Alas, unless your SQL database engine supports domains running
this script through your engine probably results in an error. We
need to use m4 first to create the real script before feeding
THAT to the engine.
Here is the sql.m4 file used to create the original SQL script.
define(domain_zip,number(5))
define(domain_address,char(50))
define(domain_city,char(30))
define(domain_phone,number(10))
define(domain_cardnumber,number(5))
define(domain_company,char(50))
define(domain_name,char(50))
Notice that we have used the built-in 'define' macro to define a
substitution for each of the domains we have established.
$ m4 sql.m4 myrolodex.m4
create table my_rolodex (
card_number number(5),
company_name char(50),
related_company char(50),
contact_name char(50),
other_name char(50),
address1 char(50),
citystate1 char(30),
zip1 number(5),
address2 char(50),
citystate2 char(30),
zip2 number(5),
home_phone number(10),
biz_phone number(10),
fax_phone number(10)
);
Changing the definitions of the domains, and re-running the m4
command given above, results in the updated SQL language script.
Too easy, right? Right.
Domains aren't so important on the example given here (limited in
size due to article length), but on a production database system
you may have more than 100 tables, each with its own copy of the
domain you established. Can you imagine finding and changing
accurately each of the references to a zip code domain two months
into the project when the post office expands zip+4 into delivery
point barcode and 6-digit add-on codes instead of 4. (True,
believe it or not.) Relational database systems are notorious
for creating many hundreds of cross-references between tables and
coordinating these cross-references without domains is asking for
trouble. m4 helps out here.
The built-in 'define' macro also accepts positional parameters
like a C program or shell script can. You can refer to these
parameters in your macro by using the $n, where 'n' is the n'th
parameter inside the parentheses. Like this:
define(new_table,create table $1)
Now invoke it:
new_table(my_rolodex) (
...
The output is as followed:
create table my_rolodex (
...
Caveat Emptor
=============
Beware of some interesting behaviour while within m4.
Unintentionally using a pre-defined macro can have unexpected
side-effects. For example the very common SQL object 'index' is
also defined in m4 for taking the index of a string. Here are
the pre-defined words included in the root m4 program... your
mileage may vary.
define, undefine, defn, pushdef, popdef, ifdef, shift,
changequote, changecom, divert, undivert, divnum, dnl,
ifelse, incr, decr, eval, len, index, substr, translit,
include, sinclude, syscmd, sysval, maketemp, m4exit,
m4wrap, errprint, dumpdef, traceon, traceoff
As you can imagine from the list of defined words, some pretty
powerful flexibility is inherent within m4(1). We will be
exploring this great tool in future articles.
Best wishes.
KSH - Features and extensions (DELPHI) Brian T. Riley
-----------------------------
Hello again boys and girls. Last month fellow Sysops ANDY and
GARS showed you a few things about the C shell and using "vi" for
editing files. In addition, LRARK discussed some of the basics of
programming in the Bourne (sh) shell. However, some of you may be
saying, "I use the Korn Shell! What about me!?". Well fear not! The
Korn shell is a super set of the Bourne Shell so every thing Rick
(LRARK) showed you will work the same way! The Korn shell adds a few
more features that we will explore later when you are more comfortable
with the basics of shell programming. For now we will concentrate on
changing your prompt like in the C shell and using "vi" editing mode
for the command line.
Changing your Prompt:
When you first start using the Korn shell, or any shell for
that matter, it doesn't tell you a lot about where you are. In fact,
it doesn't tell you anything other than the fact that it wants another
command! Well, we can fix that! ::smile:: Fortunately, with the Korn
shell it is much easier than the C shell. This time we will make KSH
tell us where we are and also how many commands we have executed this
session.
The first thing we need to do is make sure we have a .kshrc
file to hold this information so we don't have to do this every time
we log on. The .kshrc is the Korn shell equivalent of the C shells'
.cshrc file and should be in your HOME directory with your .profile.
If you don't have one already, you can create one using Vi or have
your system administrator do it for you. You also will need the
following entry in your .profile.
ENV=$HOME/.kshrc
Now we need to add (or modify) a line in the .kshrc file like
this:
PS1='$PWD '"! $ "
This tells Ksh that we are changing the primary prompt (PS1)
to include the current directory ('$PWD') and the number of commands
executed (!) so far. The ' ' tell the shell to expand the environment
variable $PWD to it's current value which just happens to be the
current directory! :) Be sure to type everything to the right of the =
exactly or it won't work! Now every time the shell displays the prompt
it will show us where we are. The second part (!) shows us how many
commands we have executed. We can use this information when we want to
recall a previous command and possibly edit it. Your prompt should
look something like this:
/u/brian 5 $_
Command line editing:
In a previous edition of this newsletter I discussed Command
line editing with the Korn shell. Due to limited space I won't go over
it in detail again, but expand it instead. Basically, all of the
commands Gary (GARS) showed you in the last issue are valid here, with
one notable exception. When editing a command line you must remember
that you are looking at a one line window that is showing you the
contents of the HISTORY file. This means that you won't see the ":"
when you press ESC, nor will you see the "~" either. When you get to
the last line in the HISTORY file the terminal will just beep (or
flash) and it won't go any farther. This will also happen if you go to
the first available command line in the file, which is set by the
HISTSIZE= variable. Let me point out that the (!) in your prompt will
show you ALL of the commands in the HISTORY file even if you can't
recall all of them! To recap, these commands work this way when you
are editing/recalling a command;
h - move one character to the left
j - display next command in the HISTORY file
k - display previous command in HISTORY file
l - move one charter to the right
0 - move to beginning of line
$ - move to end of line
i,I,a,A - same as when editing a file
o,O - are not used in command editing
G - moves to the last command in the HISTORY file
Well, that's it for this time, but, feel free to ask me for
help with anything you don't understand and I'll see you next time! :)
Brian
---------------
REMINDER - This newsletter is being sent to you 'by request'. If you do
not wish to keep receiving it, e-mail a stop notice to GARS. On the other
hand, we would very much appreciate it if you would pass the word that we
do distribute this item near the tenth (10th) of the month of issue to any-
one on GEnie who requests it, and will gladly add any name that is requested
via the same route... e-mail to GARS.
P L E A S E also remember contributions are most welcome. Please e-mail
items and/or suggestions to GARS.
(EOF)
Trademark and Copyright notices:
Unix is a Trademark of UNIX System Laboratories, Inc.; GEnie, LiveWire, and
RoundTable are Trademarks of General Electric Information Services Company;
Xenix and ms-dos are Trademarks of Microsoft Corporation; NeXT and NeXTstep
are Trademarks of NeXT Computer Systems, Inc., Coherent is a Trademark of
Mark Williams Company, Sun is a Trademark of Sun Microsystems, Inc, Sequent
is a Trademark of Sequent Computer Systems, Inc.
The contents of this newsletter are copyright (c) 1992 and may be copied whole
or in part only if original credit is included. The GEnie UNIX RoundTable is
not affiliated with AT&T or UNIX System Laboratories, Inc.